package com.project.personal_blog.garbage_classification_management_system.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    // 数据体
    private Object data;
    // 错误信息
    private String mag;
    // 状态码
    private Integer code;

    // 带数据体
    public Result(Object data, String mag) {
        this.data = data;
        this.mag = mag;
    }

    // 带状态码
    public Result(String mag, Integer code, Object data) {
        this.mag = mag;
        this.code = code;
        this.data = data;
    }

    // 不带状态码
    public Result(String mag, Integer code) {
        this.mag = mag;
        this.code = code;
    }

}
